package at.ac.tuwien.prog.entity;

import java.util.List;

import at.ac.tuwien.prog.command.ICommand;

/**
 * 
 * @author christoph.pickl@student.tuwien.ac.at
 */
public class Software {

	private final List<ICommand> commands;

	
	public Software(List<ICommand> commands) {
		if(commands == null) {
			throw new IllegalArgumentException("commands == null");
		}
		this.commands = commands;
	}

	public List<ICommand> getCommands() {
		return commands;
	}
	
	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder();
		
		sb.append("Software[commands.length="+this.commands.size()+";\n");
		for (int i = 0; i < this.commands.size(); i++) {
			sb.append("\t- ").append(i).append(".").append(this.commands.get(i).toString()).append("\n");
		}
		sb.append("]");
		
		return sb.toString();
	}
		
}
